class Lyric

  attr_accessor :artist, :album, :title, :tracknum, :mp3_filename

  def initialize(map=nil)
    map.each do |k,v|
      send("#{k}=",v)
    end if map
  end
      
  def <=>(other)
    @title<=>other.title
  end

  def to_s
    "#{@artist} - #{@title}"
  end

  def text=(a)
    @text=a.to_a
  end

  def text
    @text.join if @text
  end

  def html_text
    @text.collect{|line| h(line)}.join("<br />") if @text
  end
  
end

